<?php
$session=new CHttpSession();
$session->open();
$i=$session['i'];


if(isset($data->superuser) && $data->superuser==1){
    //管理员
    $user_title='管理员';
}
elseif($data->p->type_pg==1 && in_array($data->p->type_p_vasn, array(1,2,3,4))){
    //个人会员
    if($data->p->type_p_vasn==1){
        //尊贵会员
        $user_title='尊最会员';

    }elseif($data->p->type_p_vasn==2) {
        //高级会员
        $user_title='高级会员';

    }elseif($data->p->type_p_vasn==3) {
        //普善会员
        $user_title='普善会员';

    }elseif($data->p->type_p_vasn==4) {
        //晋学会员
        $user_title='晋学会员';
    }
}
elseif($data->p->type_pg==2 && in_array($data->p->type_g_pebg, array(1,2,3,4))){
    //团体会员会员
    if($data->p->type_g_pebg==1){
        //公共机构
        $user_title='公共机构';

    }elseif($data->p->type_g_pebg==2) {
        //学校教育
        $user_title='学校教育';

    }elseif($data->p->type_g_pebg==3) {
        //公司企业
        $user_title='公司企业';

    }elseif($data->p->type_g_pebg==4) {
        //其他团体
        $user_title='其他团体';

    }
}
?>
<form method="post">
    <tr<?php echo $i%2==1 ? '': ' class="tr1"'; ?>>
        <td align="center" class="td1<?php echo $i%2==1 ? '': ' td2'; ?>">
            <a href="/index.php?r=users/index&id=<?php echo $data->id;?>">
                <?php echo $data->p->type_pg==1?'spcf':'';?><?php echo $data->username;?>
            </a>
        </td>
        <td align="center" class="ms td1<?php echo $i%2==1 ? '': ' td2'; ?>">
            <?php echo $data->p->type_pg==1?'spcf':'';?><?php echo $data->p->nickname;?>
        </td>
        <td align="center" class="ms td1<?php echo $i%2==1 ? '': ' td2'; ?>"><?php echo isset($user_title) ? $user_title : '';?></td>
        <td align="center" class="ms td1<?php echo $i%2==1 ? '': ' td2'; ?>"><?php echo isset($data->pay->id) ? '已经提交' : '未提交';?></td>
        <td align="center" class="ms td1<?php echo $i%2==1 ? '': ' td2'; ?>">
            <?php if(isset($data->pay->id)): ?>
            <input type="radio" <?php if($data->pay->status==1) echo 'checked="checked"';?> id="status_<?php
                echo $data->pay->id;?>_1" value="1" class="radio" name="status[<?php echo $data->pay->id;?>]">
            <label for="status_<?php echo $data->pay->id;?>_1">确认</label>
            <input type="radio" <?php if($data->pay->status==0) echo 'checked="checked"';?> id="audit_<?php
                echo $data->pay->id;?>_0" value="0" class="radio" name="status[<?php echo $data->pay->id;?>]">
            <label for="audit_<?php echo $data->pay->id;?>_0">未确认</label>
            <?php else: ?>
                用户未付费
            <?php endif; ?>
        </td>
        <td align="center" class="ms td1<?php echo $i%2==1 ? '': ' td2'; ?>">
            <input type="radio" <?php if($data->p->open==1) echo 'checked="checked"';?> id="status_<?php
            echo $data->id;?>_1" value="1" class="radio" name="open[<?php echo $data->id;?>]">
            <label for="status_<?php echo $data->id;?>_1">通过</label>
            <input type="radio" <?php if($data->p->open==0) echo 'checked="checked"';?> id="audit_<?php
            echo $data->id;?>_0" value="0" class="radio" name="open[<?php echo $data->id;?>]">
            <label for="audit_<?php echo $data->id;?>_0">未通过</label>
        </td>
        <td align="center"<?php echo $i%2==1 ? '': ' class="td2"'; ?>>
            <input type="hidden" name="id" value="<?php echo $data->id;?>" />
            <input type="submit" value="更新" />
        </td>
    </tr>
</form>
<?php
$session['i']=$i+1;
?>